package com.ys.everydaynews.http

import com.ys.everydaynews.mvp.model.BaseModel
import com.ys.everydaynews.ui.main.model.CodeModel
import com.ys.everydaynews.ui.main.model.ShopDatasModel
import io.reactivex.rxjava3.core.Observable
import okhttp3.MultipartBody
import retrofit2.http.*

interface UserApi {
    @GET("Community/get_moren_shequ")
    fun getShopDatas(@Query("user_id") user_id: Int): Observable<BaseModel<ShopDatasModel>>

    @FormUrlEncoded
    @POST("user/news/sendCode")
    fun getCode(@Field("phoneNumber") phone: String): Observable<BaseModel<CodeModel>>

    @GET("ss")
    fun getUserInfo(@Header("token") token: String): Observable<BaseModel<CodeModel>>

    @Multipart
    @POST("file")
    fun setLoadImage(
        @Part field: MultipartBody.Part,
        @Header("token") token: String
    ): Observable<BaseModel<CodeModel>>

    @FormUrlEncoded
    @POST("sss")
    fun sendPart(
        @Header("token") token: String,
        @FieldMap partMap: MutableMap<String, String>
    ): Observable<BaseModel<CodeModel>>
}